package gui;

import java.awt.Graphics2D;
import java.awt.Image;

import utils.DBG;

import core.ImageLibrary;

public class TowerButton extends GameButton {

	int towerCode;
	Image towerIcon;

	boolean selected;

	public TowerButton(int towerCode_) {
		super("", 84, 84);
		towerCode = towerCode_;
		towerIcon = ImageLibrary.getInstance().getImage("tower_0"+towerCode);
		DBG.showMsg("tower_0"+towerCode, this);
		generateImage();
	}

	@Override
	public void generateImage() {
		// TODO Auto-generated method stub
		super.generateImage();
		Graphics2D gimg = (Graphics2D) image.getGraphics();
		Graphics2D gimg2 = (Graphics2D) super.over_image.getGraphics();
		if (towerIcon != null) {
			gimg.drawImage(towerIcon, 10, 10, null);
			gimg2.drawImage(towerIcon, 10, 10, null);
		}
	}

	@Override
	public void render(Graphics2D g2d) {
		// TODO Auto-generated method stub
		super.render(g2d);

	}

	public void setSelected(boolean sel) {
		selected = sel;
	}

	public boolean isSelected() {
		return selected;
	}

}
